# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=emacs-elfeed
pkgver=3.4.1_git20240326
_gitrev=5c05a1eab37bc113ecb158a4d57fe05352fa2c6a
pkgrel=0
_pkgreal=elfeed
pkgdesc="Emacs Atom/RSS feed reader"
url="https://github.com/skeeto/elfeed"
arch="noarch"
license="Unlicense"
depends="cmd:emacs"
makedepends="emacs-nox"
checkdepends="cmd:curl"
source="https://github.com/skeeto/elfeed/archive/$_gitrev/emacs-elfeed-$_gitrev.tar.gz"
builddir="$srcdir/$_pkgreal-$_gitrev"

build() {
	emacs -batch -q -no-site-file -L . \
		-f batch-byte-compile \
		./*.el
	rm -v elfeed-pkg.elc
}

check() {
	emacs -batch -q -no-site-file -L . -L tests \
		-l elfeed-tests -f ert-run-tests-batch-and-exit
}

package() {
	install -Dvm644 ./*.el ./*.elc \
		-t "$pkgdir"/usr/share/emacs/site-lisp/$_pkgreal/

	cd "$pkgdir"/usr/share/emacs/site-lisp/$_pkgreal
	emacs -batch -q -no-site-file \
		-eval "(loaddefs-generate \".\" \"$_pkgreal-loaddefs.el\")"
}

sha512sums="
681a137cf9e39bbc057f40cde1e6292c94b92d4eee26d78d0c961e7e01c4dd1fd67e659958d5d01b89a3df70e6ff1d7c0b2089eef91c36dee485607deb1958be  emacs-elfeed-5c05a1eab37bc113ecb158a4d57fe05352fa2c6a.tar.gz
"
